<template>
 <div class='home'>
     <div>
         对象传参，使用深度监听或者v-if
     </div>

     <children :oneList="oneList" />

       <div>
         我是父组件,下面这个是数组子组件,数组传参，不会有问题
     </div>
     <children1 :lists="lists" />
 </div>
</template>

<script>
import children from "@/components/children.vue"
import children1 from "@/components/children1.vue"
import axios from "axios"
   export default {
      data() {
          return {
              oneList:{},   //此处必须设成空对象
              lists:null
          }
      },
      //生命周期 - 创建完成
     created(){ 
       
     },

     //DOM挂载完毕
     mounted() {
         this.getOneList()
         this.getLists()

     },
     components:{
         children,
         children1
     },
      methods: {
         async getOneList(){
             let data=await axios.get("http://127.0.0.1:3000/ceshi")
             this.oneList=data.data.data
          },
           async getLists(){
             let data=await axios.get("http://127.0.0.1:3000/ceshi/lists")
             this.lists=data.data.data
          },


      },
 }
</script>

<style lang='less' scoped>

</style>